package com.eliza.base.views.learn.gestures

import androidx.compose.foundation.layout.Column
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.tooling.preview.Preview
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController

@Preview
@Composable
fun LearnGesturesScreenPre() {
    LearnGesturesScreen(rememberNavController())
}

@Composable
fun LearnGesturesScreen(navController: NavController) {
    Column {
        var count by remember {
            mutableIntStateOf(0)
        }
        Button(onClick = { count = (count + 1) % 2 }) {
            Text(text = "點擊切換")
        }
        when (count) {
            0 -> DragScreen(navController)
            1 -> ScrollScreen(navController)
            else -> {}
        }
    }

}
